-
Notifications
You must be signed in to change notification settings - Fork 189
[v7r2] Run pytest test collection for Python 3 #4718
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
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
62b10d7
PY3: Replace "import thread" with "from six.moves import _thread as t…
chrisburr b9b6299
PY3: Replace "import urlparse" with "import six.moves.urllib.parse"
chrisburr 4f3f839
PY3: Remove Python version check on import
chrisburr d285b56
PY3: Encode strings as UTF-8 before using hashlib.md5
chrisburr 604de9c
PY3: Allow importing DEncode in Python 3 without actually porting it
chrisburr 4bdc9b0
PY3: Replace "import Queue" with "from six.moves import queue as Queue"
chrisburr 331c7ed
PY3: Replace "itertools.izip_longest" with "six.moves.zip_longest"
chrisburr 58d240d
PY3: Get urllib2.URLError from six.moves.urllib_error
chrisburr 846d8a6
PY3: Escape backslash in Core/Utilities/Grid.py
chrisburr 0716316
PY3: Minimal types fixes to make pytest discovery functional
chrisburr 5a66509
PY3: Remove MySQLdb.server_init if using mysqlclient
chrisburr 7ece6c3
PY3: Replace StringIO with six.StringIO and six.BytesIO
chrisburr 69f058b
PY3: Fix string type checking in Core/Utilities/Time.py
chrisburr 8a4eaf1
PY3: Fallback to subprocess.getstatusoutput for commands.getstatusoutput
chrisburr c8c1f9d
Run pytest discovery with Python 3
chrisburr 80e5466
Fix pycodestyle indentation errors
chrisburr bfa7ae9
Spelling corrections from code review
chrisburr fd23b16
Fix typo for test_types in Test_Encode.py
chrisburr 5884f20
Fix typo in .github/workflows/basic-python3.yml
chrisburr 305202c
Add pycurl and subprocess32 to environment-py3.yml
chrisburr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Python 3 tests | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name != 'push' || github.repository == 'DIRACGrid/DIRAC' | ||
| timeout-minutes: 30 | ||
|
|
||
| strategy: | ||
| fail-fast: False | ||
| matrix: | ||
| command: | ||
| # Only collect tests for now | ||
| - pytest --no-cov --collect-only | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Fail-fast for outdated pipelines | ||
| run: .github/workflows/fail-fast.sh | ||
| - name: Prepare environment | ||
| run: | | ||
| conda env create --name dirac-testing --file environment-py3.yml | ||
| - name: Run tests | ||
| run: | | ||
| source "${CONDA}/bin/activate" | ||
| conda activate dirac-testing | ||
| set -euxo pipefail | ||
| export PYTHONPATH=${PWD%/*} | ||
| ${{ matrix.command }} | ||
| env: | ||
| REFERENCE_BRANCH: ${{ github['base_ref'] || github['head_ref'] }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check, but when
StringIOor BytesIO`?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's analogous to opening a file with
open(filename, mode="wt")andopen(filename, mode="wb")though Python 2 doesn't do a very good job teaching you to think about the difference.StringIOshould be used when you want something you would open in a text editor: XML files, JDL, HTML.BytesIOshould be used when you just want a bag of bytes such as a compressed tarfile or an image. Also if you want to hash something with md5, you need bytes as different encodings will result in different hashes.I think I've got these correct but we'll only know for sure when we start executing tests. I have a draft branch locally which gets 80% of them passing so I'll make a PR to start executing tests as soon as this PR is merged.