@@ -16,22 +16,22 @@ namespace Python.DomainReloadTests
16
16
/// 3. This class at runtime creates a directory that has both C# and
17
17
/// python code, and compiles the C#.
18
18
/// 4. This class then runs the C# code.
19
- ///
20
- /// But wait there's more indirection. The C# code that's run -- known as
21
- /// the test runner --
22
- /// This class compiles a DLL that contains the class which code will change
23
- /// and a runner executable that will run Python code referencing the class.
24
- /// Each test case:
19
+ ///
20
+ /// But there's a bit more indirection. This class compiles a DLL that
21
+ /// contains code that will change.
22
+ /// Then, the test case:
25
23
/// * Compiles some code, loads it into a domain, runs python that refers to it.
26
- /// * Unload the domain.
27
- /// * Compile a new piece of code, load it into a domain, run a new piece of python that accesses the code.
24
+ /// * Unload the domain, re-runs the domain to make sure domain reload happens correctly.
25
+ /// * Compile a new piece of code, load it into a new domain, run a new piece of
26
+ /// Python code to test the objects after they've been deleted or modified in C#.
28
27
/// * Unload the domain. Reload the domain, run the same python again.
28
+ ///
29
29
/// This class gets built into an executable which takes one argument:
30
30
/// which test case to run. That's because pytest assumes we'll run
31
31
/// everything in one process, but we really want a clean process on each
32
- /// test case to test the init/reload/teardown parts of the domain reload
33
- /// code.
32
+ /// test case to test the init/reload/teardown parts of the domain reload.
34
33
/// </summary>
34
+ ///
35
35
class TestRunner
36
36
{
37
37
const string TestAssemblyName = "DomainTests" ;
@@ -347,12 +347,6 @@ assert called is True
347
347
called = False
348
348
Cls.Call()
349
349
assert called is False
350
- #try:
351
- # assert 2 == Cls.Before
352
- #except TypeError:
353
- # print('Caught expected exception')
354
- #else:
355
- # raise AssertionError('Failed to throw exception')
356
350
" ,
357
351
} ,
358
352
@@ -398,7 +392,6 @@ def before_reload():
398
392
def after_reload():
399
393
try:
400
394
TestNamespace.Cls(2)
401
- sys.my_cls.Member()
402
395
except AttributeError:
403
396
print('Caught expected exception')
404
397
else:
@@ -845,7 +838,7 @@ raise AssertionError('failed to raise')
845
838
# foo should have changed
846
839
assert foo.num == 7
847
840
assert bar.num == 7
848
- # Pythonnet also returns a new object with `ref`-quialified parameters
841
+ # Pythonnet also returns a new object with `ref`-qualified parameters
849
842
assert foo is not bar
850
843
" ,
851
844
} ,
@@ -1029,7 +1022,6 @@ static string CreateCaseRunnerAssembly(string verb, string shutdownMode = "Shutd
1029
1022
}
1030
1023
static string CreateAssembly ( string name , string code , bool exe = false )
1031
1024
{
1032
- // Console.WriteLine(code);
1033
1025
// Never return or hold the Assembly instance. This will cause
1034
1026
// the assembly to be loaded into the current domain and this
1035
1027
// interferes with the tests. The Domain can execute fine from a
0 commit comments