From 000ad8e41c56a4d78f6745b062377a54a15aacf1 Mon Sep 17 00:00:00 2001 From: Jeremy Grifski Date: Tue, 10 May 2022 23:24:07 -0400 Subject: [PATCH] Fixed Code Loading Bug (#50) * Added an integration code test * Fixed the code loading bug * Incremented version --- docs/changelog.rst | 3 +++ setup.py | 2 +- subete/repo.py | 1 - tests/test_integration.py | 5 +++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ed3ca94..6129526 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,6 +7,9 @@ newest changes first. 0.11.x ------- +* v0.11.2 + * Fixed a bug where code could not be loaded because the repo was deleted + * v0.11.1 * Fixed an issue where local repo could cause stack overflow * Added sections to the changelog diff --git a/setup.py b/setup.py index abd0c30..5ed0569 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ MAJOR = 0 MINOR = 11 -PATCH = 1 +PATCH = 2 name = "subete" version = f"{MAJOR}.{MINOR}" diff --git a/subete/repo.py b/subete/repo.py index 7dea837..6475e0a 100644 --- a/subete/repo.py +++ b/subete/repo.py @@ -34,7 +34,6 @@ def __init__(self, source_dir: Optional[str] = None) -> None: self._total_tests: int = sum(1 for _, x in self._languages.items() if x.has_testinfo()) self._load_git_data() self._git_repo.close() # Closes the repo before cleaning up the temp dir - self._temp_dir.cleanup() def __getitem__(self, language: str) -> LanguageCollection: """ diff --git a/tests/test_integration.py b/tests/test_integration.py index c54fa4e..dabd48b 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -76,6 +76,11 @@ def test_modified_not_none(): assert program.modified() is not None +def test_code(): + program: subete.SampleProgram = TEST_REPO["Python"]["Hello World"] + assert program.code() == "print('Hello, World!')\n" + + def test_project_has_test(): program: subete.SampleProgram = TEST_REPO["Google Apps Script"]["Hello World"] assert program.project().has_testing()