ehmatthes / django-simple-deploy

A reusable Django app that configures your project for deployment
BSD 3-Clause "New" or "Revised" License
307 stars 26 forks source link

Run unit tests on Windows #237

Closed ehmatthes closed 1 year ago

ehmatthes commented 1 year ago

Running unit tests on Windows should go a long way toward making sure everything works on Windows.

ehmatthes commented 1 year ago

Working notes

ehmatthes commented 1 year ago

tmp_project = WindowsPath('C:/Users/eric/AppData/Local/Temp/pytest-of-eric/pytest-4/blog_project0') capfd = <_pytest.capture.CaptureFixture object at 0x000002178B03A210>

def test_help_output(tmp_project, capfd):
    """Call `manage.py simple_deploy --help`."""
    valid_sd_command = "python manage.py simple_deploy --help"
  stdout, stderr = msp.call_simple_deploy(tmp_project, valid_sd_command)

C:\Users\eric\django-simple-deploy\unit_tests\platform_agnostic_tests\test_valid_cli_commands.py:22:


C:\Users\eric\django-simple-deploy\unit_tests\utils\manage_sample_project.py:161: in call_simple_deploy sd_call = subprocess.Popen(split(sd_command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) C:\Users\eric\AppData\Local\Programs\Python\Python311\Lib\subprocess.py:1024: in init self._execute_child(args, executable, preexec_fn, close_fds,



- All platform-agnostic tests pass. There were issues with conversion of commands on Windows. GPT was really helpful in sorting through these. For the record, it did not suggest clear fixes, there was a lot of back and forth, but so much more efficient than SO and documentation dives.
ehmatthes commented 1 year ago

Testing heroku

ehmatthes commented 1 year ago

Testing fly_io