We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b2f29b1 commit 741dffdCopy full SHA for 741dffd
src/pylib/Lib/unittest.nim
@@ -1,3 +1,5 @@
1
2
-import ./unittest/case_py
3
-export case_py
+import ../private/trans_imp
+impExp unittest,
4
+ case_py, main_impl
5
+
src/pylib/Lib/unittest/main_impl.nim
@@ -0,0 +1,23 @@
+import std/macros
+import std/macrocache
+import ./case_py/[
+ types,
6
+]
7
+const TestCaseSubclasses = CacheSeq"TestCaseSubclasses"
8
9
+macro init_subclass*[T: TestCase](cls: typedesc[T]) =
10
+ TestCaseSubclasses.add cls
11
12
+macro main*() =
13
+ result = newStmtList()
14
+ for c in TestCaseSubclasses:
15
+ result.add newCall(
16
+ newDotExpr(
17
+ #ident("new" & c.strVal)
18
+ newCall c
19
+ ,
20
+ ident"run")
21
+ )
22
23
0 commit comments