def test_unknown_attribute(): os.environ['XSSNOTIFIER_CONFIG'] = 'tests/test_config.ini' try: c = Config() with pytest.raises(AttributeError): c.nonexisting() finally: del os.environ['XSSNOTIFIER_CONFIG']