twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
362 stars 74 forks source link

`alltests.py` does not seem to run any test #125

Open s-leroux opened 5 years ago

s-leroux commented 5 years ago

Trying to run the tests in the NBT/tests folder I noticed the alltests.py does not seem to run any test. Or am I doing something wrong?

sh$ pwd
/local/sylvain/Minecraft-debug/NBT/tests
sh$ python3 --version
Python 3.5.3
sh$ python3 -m unittest alltests.py 

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
donno commented 3 years ago

alltests.py doesn't contain any testcases recognised by the unittest's loader or test discovery. Instead it has a custom main. that creates the test runner and loads the test cases itself from the other modules.

To run the tests you run the alltests.py as a script.

python3 alltests.py

Or if you were in the parent directory.

python3 tests/alltests.py

That said, for me a number of the tests fail due to seed.py being missing (its located in the examples directory).