Skip to content
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

Reveal and fix a masked test #1671

Merged
merged 3 commits into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions traits/etsconfig/tests/test_etsconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,20 +202,19 @@ def test_set_company(self):
self.ETSConfig.company = old
self.assertEqual(old, self.ETSConfig.company)

def _test_default_application_home(self):
def test_default_application_home(self):
"""
application home

"""

# This test is only valid when run with the 'main' at the end of this
# file: "python app_dat_locator_test_case.py", in which case the
# app_name will be the directory this file is in ('tests').
app_home = self.ETSConfig.application_home
(dirname, app_name) = os.path.split(app_home)

self.assertEqual(dirname, self.ETSConfig.application_data)
self.assertEqual(app_name, "tests")

# The assumption here is that the test was run using unittest and not
# a different test runner e.g. using "python -m unittest ...".
self.assertEqual(app_name, "unittest")

def test_toolkit_default_kiva_backend(self):
self.ETSConfig.toolkit = "qt4"
Expand Down Expand Up @@ -363,14 +362,3 @@ def test_write_to_user_data_directory(self):
os.remove(path)

self.assertEqual(data, result)


# For running as an individual set of tests.
if __name__ == "__main__":

# Add the non-default test of application_home...non-default because it
# must be run using this module as a script to be valid.
suite = unittest.TestLoader().loadTestsFromTestCase(ETSConfigTestCase)
suite.addTest(ETSConfigTestCase("_test_default_application_home"))

unittest.TextTestRunner(verbosity=2).run(suite)