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 Greg Couch, 7 years ago

Cc: Conrad Huang added

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.

comment:2 by Greg Couch, 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'.

Last edited 7 years ago by Greg Couch (previous) (diff)

comment:3 by Greg Couch, 7 years ago

Resolution: fixed
Status: assignedclosed

testing scripts renamed to cxtest.py

Note: See TracTickets for help on using tickets.