Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed Oct 15, 2023
1 parent 37e5180 commit 371cb47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/setenvironment/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def parse_args() -> argparse.Namespace:
args = parser.parse_args()
return args


def main() -> int:
"""Main entry point."""
args = parse_args()
Expand Down
5 changes: 2 additions & 3 deletions tests/test_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import unittest

from setenvironment.setenv import get_env
from setenvironment.types import OsEnvironment


class SanityTester(unittest.TestCase):
Expand All @@ -19,8 +18,8 @@ def test_os_make_environment(self) -> None:
data = dict(os.environ)
print(data)
self.assertTrue(data)
#os_env = OsEnvironment()
#print(os_env)
# os_env = OsEnvironment()
# print(os_env)
self.fail("Force test_os_make_environment crash to read output\n" + str(data))

def test_get_env(self) -> None:
Expand Down
15 changes: 1 addition & 14 deletions tests/test_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def tearDown(self) -> None:
env: RegistryEnvironment = query_registry_environment()
self.assertNotIn("value not set", env.user.paths)


# teardown
def test_print_failure(self) -> None:
"""Remove the environment variable."""
from setenvironment.setenv_win32 import (
RegistryEnvironment,
query_registry_environment,
)

env: RegistryEnvironment = query_registry_environment()
print(env)
self.fail("force failure")
Expand All @@ -51,19 +51,6 @@ def test_get_env_path_system_registry(self) -> None:
self.assertIn("C:\\Windows", paths)
print("done")

@unittest.skipIf(sys.platform != "win32", "Windows only test")
def test_get_env_path_system_registry(self) -> None:
"""Test setting an environment variable."""
from setenvironment.setenv_win32 import (
get_env_path_system,
get_env_path_user,
parse_paths_win32,
)

path_str = get_env_path_system() + ";" + get_env_path_user()
paths = parse_paths_win32(path_str)
self.assertIn("C:\\Windows", paths)
print("done")

@unittest.skipIf(sys.platform != "win32", "Windows only test")
def test_temp_dir_is_resolved(self) -> None:
Expand Down

0 comments on commit 371cb47

Please sign in to comment.