Skip to content

Commit 7609ffd

Browse files
Added instructions for Python testing to automated_testing.md
1 parent 556c205 commit 7609ffd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

technical/automated_testing.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ class TestVersion(unittest.TestCase):
7878
os.unlink(temp.name)
7979
```
8080

81+
If you are developing a FreeCAD module, place the above in a file inside your module, and register your unit test with FreeCAD's Test Workbench by adding this in your Init.py file:
82+
83+
```
84+
FreeCAD.__unit_test__ += ["my_file"]
85+
```
86+
87+
Then you can run your tests either from inside FreeCAD, using the Test workbench and running the "Self Test" command, or from the command line by issuing:
88+
89+
```
90+
FreeCAD -t my_file
91+
```
92+
8193
## C++ Testing
8294

8395
In an ideal world, a C++ unit test would be perfectly isolated from any external dependencies, which would be replaced with minimal, instrumented "mock" versions of themselves. However,

0 commit comments

Comments
 (0)