@@ -16,22 +16,22 @@ namespace Python.DomainReloadTests
1616 /// 3. This class at runtime creates a directory that has both C# and
1717 /// python code, and compiles the C#.
1818 /// 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:
2523 /// * 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#.
2827 /// * Unload the domain. Reload the domain, run the same python again.
28+ ///
2929 /// This class gets built into an executable which takes one argument:
3030 /// which test case to run. That's because pytest assumes we'll run
3131 /// 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.
3433 /// </summary>
34+ ///
3535 class TestRunner
3636 {
3737 const string TestAssemblyName = "DomainTests" ;
@@ -347,12 +347,6 @@ assert called is True
347347 called = False
348348 Cls.Call()
349349 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')
356350" ,
357351 } ,
358352
@@ -398,7 +392,6 @@ def before_reload():
398392def after_reload():
399393 try:
400394 TestNamespace.Cls(2)
401- sys.my_cls.Member()
402395 except AttributeError:
403396 print('Caught expected exception')
404397 else:
@@ -845,7 +838,7 @@ raise AssertionError('failed to raise')
845838 # foo should have changed
846839 assert foo.num == 7
847840 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
849842 assert foo is not bar
850843 " ,
851844 } ,
@@ -1029,7 +1022,6 @@ static string CreateCaseRunnerAssembly(string verb, string shutdownMode = "Shutd
10291022 }
10301023 static string CreateAssembly ( string name , string code , bool exe = false )
10311024 {
1032- // Console.WriteLine(code);
10331025 // Never return or hold the Assembly instance. This will cause
10341026 // the assembly to be loaded into the current domain and this
10351027 // interferes with the tests. The Domain can execute fine from a
0 commit comments