Opened 7 years ago
Closed 7 years ago
#1335 closed defect (fixed)
Python testing scripts: 'session' not available
| Reported by: | Eric Pettersen | Owned by: | Greg Couch |
|---|---|---|---|
| Priority: | blocker | Milestone: | 0.9 |
| Component: | Build System | Version: | |
| Keywords: | Cc: | Conrad Huang | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
In Python testing scripts (e.g. hbonds/disabled-test.py), 'session' is not available for the current session, which makes it difficult to do a wide variety of things necessary for testing.
Change History (3)
comment:1 by , 7 years ago
| Cc: | added |
|---|
comment:2 by , 7 years ago
Bundle builder uses setuptools to build wheels. If the 'test' argument is given, then Python's unittest module is invoked. unittest imports all 'test*.py' files and looks for tests in them. Consequently, test.py was imported and failed because 'session' was not available. That could have been fixed by placing the test in a function and calling it if __name__.startswith("ChimeraX_sandbox"). However:
The solution is to rename the post-install tests to be files that start with 'cxtest' instead of 'test'.
comment:3 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
testing scripts renamed to cxtest.py
In this case, test.py was being called by bundler_bundler, not the post-install test scaffolding. Will look into why bundle building acts the way it does.