-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding test #46
adding test #46
Conversation
and maybe those test could happen on travis... |
and those tests could be a start point for other clipping libraries |
Thank you Frederik! The tests are already running on Travis, the unittest-style tests are automatically discovered by pytest, and run by tox inside a virtual environment. They fail because one file is attempting to import from mojo (RF-only) and another from fontPens, which is not specified as a test requirement. What is that The missing |
that |
there's an open issue about fontPens.digestPointPen robotools/fontPens#12, I guess it's better to wait that before tagging the first fontPens release on PyPI? If you want to keep that |
does pytest auto discover tests outside the lib? |
yes, it does. It currently searches in Lib/booleanOperations and in an external tests/ folder. In general I prefer to have the test suite in an external directory instead of inside the library, because it is not necessary at runtime for normal users, only for developers. And pytest can discover external tests just fine. The reason I put |
its now outside the lib but it seem not to be finding the ufo data... |
tests/testBooleanGlyph.py
Outdated
|
||
|
||
def _addGlyphTests(): | ||
root = os.path.join(os.path.dirname(__file__), 'testdata') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/testdata/testData/
I dont get |
https://docs.pytest.org/en/latest/customize.html you can either rename the testBooleanGlyph.py module to something pytest can find, or you can tell pytest to consider test modules all the files that, e.g. start with You need to add this to the diff --git a/setup.cfg b/setup.cfg
index fc112fd..c00e98a 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -12,6 +12,8 @@ minversion = 3.0.2
testpaths =
Lib/booleanOperations
tests
+python_files =
+ test*.py
addopts =
# run py.test in verbose mode
-v |
oh thanks, this feels magically! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
will merge it when fontPens is in PyPi so the digestPointPen can be removed good to have some test and a platform to easy add tests |
@typemytype can we merge this now? sorry I let this go.. |
@anthrotype euh these are weird errors, I guess https://ci.appveyor.com/project/typemytype/booleanoperations/build/1.0.120 |
fixed, thanks |
No description provided.