Skip to content

[pytest] Relocate Session Level Fixtures To Test Files#1795

Merged
tahmed-dev merged 1 commit intosonic-net:masterfrom
tahmed-dev:taahme/relocate-session-level-fixture-to-test-file
Jun 23, 2020
Merged

[pytest] Relocate Session Level Fixtures To Test Files#1795
tahmed-dev merged 1 commit intosonic-net:masterfrom
tahmed-dev:taahme/relocate-session-level-fixture-to-test-file

Conversation

@tahmed-dev
Copy link
Contributor

Description of PR

Summary:

Commit b0237f1 introduced session level fixtures, however indirect
import of those fixtures is not being respected. Relocation of
fixture import to pytest test files solves this issue.

signed-off-by: Tamer Ahmed [email protected]

Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Fixing failures when running test case with indirect import of session level fixture

How did you do it?

Relocate import to test files

How did you verify/test it?

ran with and without this issue test_qos_sai. Issue is resolved with this fix

tests$ pytest qos/test_qos_sai.py --testbed=vms12-t0-s6000-1 --inventory=../ansible/str --testbed_file=../ansible/testbed.csv --host-pattern=str-s6000-acs-14 --module-path=../ansible/library --disable_loganalyzer --skip_sanity
================================================================================================================================================== test session starts ==================================================================================================================================================
platform linux2 -- Python 2.7.12, pytest-4.6.9, py-1.8.1, pluggy-0.13.1
ansible: 2.8.7
rootdir: /var/host-acs-mgmt-repo/tests, inifile: pytest.ini
plugins: ansible-2.2.2
collected 1 item                                                                                                                                                                                                                                                                                                        

qos/test_qos_sai.py .                                                                                                                                                                                                                                                                                             [100%]

============================================================================================================================================== 1 passed in 396.14 seconds ===============================================================================================================================================

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Commit b0237f1 introduced session level fixtures, however indirect
import of those fixtures is not being respected. Relocation of
fixture import to pytest test files solves this issue.

signed-off-by: Tamer Ahmed <[email protected]>
@tahmed-dev tahmed-dev requested a review from a team June 19, 2020 19:00
@lgtm-com
Copy link

lgtm-com bot commented Jun 19, 2020

This pull request introduces 8 alerts and fixes 8 when merging bcc3dfa into eefb131 - view on LGTM.com

new alerts:

  • 8 for Unused import

fixed alerts:

  • 8 for Unused import

@tahmed-dev tahmed-dev merged commit 48cd6d4 into sonic-net:master Jun 23, 2020
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
* d03ba4f [202012] [portstat, intfstat] added rates and utilization  (sonic-net#1812)
* 499ad3f [config reload] Fix config reload failure due to sonic.target job cancellation (sonic-net#1814)
* 96d658c [202012][sonic installer] Add swap setup support (sonic-net#1815)
* a9c6970 platform pre-check for reboot in 202012 branch (sonic-net#1788)
* 0e0478b Unify the number format in the ourput of portstat and pfcstat in all cases (sonic-net#1795)
* 2d1e00e [ecnconfig] Fix exception seen during display and add unit tests (#1784) (sonic-net#1789)

Signed-off-by: Volodymyr Samotiy <[email protected]>
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