Skip to content

Commit

Permalink
Clean up UI for pytest machine config (#204)
Browse files Browse the repository at this point in the history
- when exiting due to assertion, make the message more focused by
  avoiding pytests INTERNALERROR wrapper and whole stacktrace
- also add suggestion of available --ignore_machine_config override
  • Loading branch information
wconstab committed Jan 27, 2021
1 parent 2dc08cf commit ccea180
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ def set_fuser(fuser):
torch._C._jit_set_texpr_fuser_enabled(True)

def pytest_sessionstart(session):
if not session.config.getoption('ignore_machine_config'):
try:
check_machine_configured()
except Exception as e:
if not session.config.getoption('ignore_machine_config'):
pytest.exit(f"{e}\nUse --ignore_machine_config arg if not running with recommended tuning settings")

def pytest_configure(config):
set_fuser(config.getoption("fuser"))
Expand Down

0 comments on commit ccea180

Please sign in to comment.