Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test suite to Pytest (replace Behave) #1193

Merged
merged 67 commits into from Jul 3, 2021
Merged

Conversation

wren
Copy link
Member

@wren wren commented Feb 14, 2021

Fixes #1192

Moves test suite entirely into pytest from behave.

@wren wren marked this pull request as draft February 14, 2021 01:04
@wren wren force-pushed the develop branch 12 times, most recently from 8bd89b7 to 7bacf4a Compare March 13, 2021 23:28
@micahellison micahellison force-pushed the develop branch 2 times, most recently from 9eb9990 to f50b430 Compare March 20, 2021 19:25
@wren wren force-pushed the develop branch 6 times, most recently from ea37d4b to 50c053c Compare March 27, 2021 19:34
@micahellison
Copy link
Member

I'm getting some IO and recursion errors while running these on Windows. These repeats a ton:

 Traceback (most recent call last):
    File "c:\users\micah\.pyenv\pyenv-win\versions\3.8.2\lib\tempfile.py", line 803, in onerror
      _os.unlink(path)
  PermissionError: [WinError 5] Access is denied: 'C:\\Users\\micah\\AppData\\Local\\Temp\\tmpyzro5wbt'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "c:\users\micah\.pyenv\pyenv-win\versions\3.8.2\lib\shutil.py", line 617, in _rmtree_unsafe
      os.rmdir(path)
  PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\micah\\AppData\\Local\\Temp\\tmpyzro5wbt'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "c:\users\micah\.pyenv\pyenv-win\versions\3.8.2\lib\tempfile.py", line 803, in onerror
      _os.unlink(path)
  PermissionError: [WinError 5] Access is denied: 'C:\\Users\\micah\\AppData\\Local\\Temp\\tmpyzro5wbt'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "c:\users\micah\.pyenv\pyenv-win\versions\3.8.2\lib\shutil.py", line 617, in _rmtree_unsafe
      os.rmdir(path)
  PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\micah\\AppData\\Local\\Temp\\tmpyzro5wbt'

  During handling of the above exception, another exception occurred:

And at the end, I get:


 RecursionError: maximum recursion depth exceeded while calling a Python object

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/warnings.html

@MinchinWeb
Copy link
Contributor

As a headsup, I discovered today that the current behave test suite does not run as expected (at all?) if not run from the project root folder.

@micahellison
Copy link
Member

Let's move off of pyflakes, probably to pylint, maaaaybe to flake8, though pylint looks better at first glance.

@micahellison micahellison changed the title [WIP] Move test suite to Pytest (replace Behave) Move test suite to Pytest (replace Behave) Jul 3, 2021
wren and others added 7 commits July 3, 2021 15:43
- Implement mock editor fixture
- Add fixture to keep track of editor state
- Implement various steps to check editor state

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
@micahellison micahellison marked this pull request as ready for review July 3, 2021 22:43
wren and others added 17 commits July 3, 2021 15:44
- This was awful and convoluted

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
- Take out old steps from format and input tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Run formatter
- Take out old tags
- Use new steps on tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Take out old type coersion (it was causing needles complexity)
- Take out `read_value_from_string` function
- Use taml parser to parse yaml instead of using custom function
- Update tests to use new implementation

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Misc linting issues
- Whitespace cleanup
- Entire test suite is now passing
- Add misc todo items in comments

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Fix failing DayOne test
- Make format and clean up extraneous comment

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Now that all the tests are passing, this breaks them up into a few
different files to make everything more organized.

Note: Pyflakes is complaining about some unused import statements.
@micahellison micahellison added the build Issues related to the build pipeline label Jul 3, 2021
Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪

@wren wren merged commit 2648413 into jrnl-org:develop Jul 3, 2021
@wren wren deleted the pytest-bdd branch July 3, 2021 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to the build pipeline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move test suite entirely to Pytest (replace Behave)
3 participants