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

Convert ResourceRelatedField test to pytest styled tests #887

Merged
merged 1 commit into from
Feb 15, 2021

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Feb 12, 2021

Working in progress for #468

Description of the Change

Of test module test_relations for now only moved ResourceRelatedField related tests to keep the PR to a reasonable size.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@sliverc sliverc requested a review from n2ygk February 12, 2021 18:46
@codecov
Copy link

codecov bot commented Feb 12, 2021

Codecov Report

Merging #887 (46d0998) into master (5488b18) will decrease coverage by 0.06%.
The diff coverage is 98.80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #887      +/-   ##
==========================================
- Coverage   97.80%   97.73%   -0.07%     
==========================================
  Files          60       60              
  Lines        3325     3269      -56     
==========================================
- Hits         3252     3195      -57     
- Misses         73       74       +1     
Impacted Files Coverage Δ
example/settings/dev.py 100.00% <ø> (ø)
tests/test_relations.py 98.85% <98.55%> (-1.15%) ⬇️
tests/conftest.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5488b18...041b78b. Read the comment docs.

Copy link
Contributor

@n2ygk n2ygk left a comment

Choose a reason for hiding this comment

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

Umm, this stuff is a little out of my league but, sure, let's do it.

@n2ygk n2ygk merged commit aedc5d9 into django-json-api:master Feb 15, 2021
@sliverc sliverc deleted the test_relations branch February 15, 2021 18:35
@sliverc
Copy link
Member Author

sliverc commented Feb 16, 2021

@n2ygk Thanks. Once you have an understanding of the basic pytest features such as fixtures this code becomes very simple. I recommend you to read a tutorial such as https://realpython.com/pytest-python-testing/ which summarizes the difference between unittest and pytest quite well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants