summaryrefslogtreecommitdiff
path: root/alembic/testing
diff options
context:
space:
mode:
authorCaselIT <cfederico87@gmail.com>2019-12-27 12:06:39 -0500
committersqla-tester <sqla-tester@sqlalchemy.org>2019-12-27 12:06:39 -0500
commit98177eb24070b8845dccea387b044b21550ea1eb (patch)
treee2b85fbea084c9b041bf06d462768e650936b9ce /alembic/testing
parentc85c89a11528d7f342fca9e04a56663521c774a2 (diff)
downloadalembic-98177eb24070b8845dccea387b044b21550ea1eb.tar.gz
Fix tests on windows
<!-- Provide a general summary of your proposed changes in the Title field above --> Update the tests to make them run on windows ### Description <!-- Describe your changes in detail --> The main changes are: - Correctly manage the paths on windows vs *nix like system. - Manage the new lines \r\n vs \n - Windows cannot remove open files, namely the sqlite db, so it keeps track of the connections and closes them before removing the files. I've tested with sqlite, postgres and mysql and all pass (on windows 10) This fixes #632 ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #639 Pull-request: https://github.com/sqlalchemy/alembic/pull/639 Pull-request-sha: c6b7794510b5179f6ea574019df79a040e3c5f42 Change-Id: Ibbf7e1da941196d98d6a2e60d5f1bb3a253cca2b
Diffstat (limited to 'alembic/testing')
-rw-r--r--alembic/testing/env.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/alembic/testing/env.py b/alembic/testing/env.py
index 15f7777..473c73e 100644
--- a/alembic/testing/env.py
+++ b/alembic/testing/env.py
@@ -60,6 +60,9 @@ def staging_env(create=True, template="generic", sourceless=False):
def clear_staging_env():
+ from sqlalchemy.testing import engines
+
+ engines.testing_reaper.close_all()
shutil.rmtree(_get_staging_directory(), True)