peerdavid / remapy

An open source explorer for your remarkable tablet to show, upload or delete files via the remarkable cloud.
Apache License 2.0
174 stars 19 forks source link

How do you run the test modules? #35

Closed ghost closed 2 years ago

ghost commented 3 years ago

This might be a dumb question. I want to run annotation_test.py to experiment on issue #34.

I ran

cd remapy/
source env/bin/activate

First I tried

python3 test/annotation_test.py

which of course results in

Traceback (most recent call last):
  File "test/annotation_test.py", line 3, in <module>
    from model.render import pdf
ModuleNotFoundError: No module named 'model'

Then I tried

python3 -m test.annotation_test

which usually properly understands imports, but gives

/home/username/.apps/remapy/env/bin/python3: No module named test.annotation_test

here.

However, I can get it to work by renaming the test dir

mv test test2
python3 -m test2.annotation_test

This fixes the error above, because it circumvents the python standard library module "test".

How do I run the tests properly?

peerdavid commented 3 years ago

Thanks - yea could easily be that I destroyed something due to re-organizing folders etc. Feel free to propose a different solution

peerdavid commented 2 years ago

Should be done with #57