]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Fix tests on windows
authorCaselIT <cfederico87@gmail.com>
Fri, 27 Dec 2019 17:06:39 +0000 (12:06 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Fri, 27 Dec 2019 17:06:39 +0000 (12:06 -0500)
commit98177eb24070b8845dccea387b044b21550ea1eb
treee2b85fbea084c9b041bf06d462768e650936b9ce
parentc85c89a11528d7f342fca9e04a56663521c774a2
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
alembic/testing/env.py
tests/test_command.py
tests/test_script_production.py