Skip to content

Test in Python 3.6 #1

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

Merged
merged 3 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [ 3.6, 3.8 ]

steps:
- uses: actions/checkout@v2
Expand All @@ -38,4 +38,4 @@ jobs:
- name: Start from clean state
run: make clean
- name: Run tests
run: make check
run: make PYTHON3=python check
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

SHELL := /bin/bash

PYTHON3 ?= $(shell which python3.9 2>/dev/null || which python3.8 2>/dev/null || which python3.7 2>/dev/null || which python3.6 2>/dev/null || which python3)

all:

.PHONY: \
Expand All @@ -38,6 +40,7 @@ all:
check: \
.git_submodule_init.done.log
$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory tests \
check

Expand Down
5 changes: 4 additions & 1 deletion tests/case_file/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ kb.ttl: \
mv _$@ $@

sample.txt.done.log: \
$(tests_srcdir)/.venv.done.log \
sample_txt.py
python3 sample_txt.py sample.txt
source $(tests_srcdir)/venv/bin/activate \
&& python3 sample_txt.py \
sample.txt
touch $@

# Display difference between rdflib default output and compacted output.
Expand Down
5 changes: 3 additions & 2 deletions tests/case_file/sample_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
Mtime should be 2010-01-02T03:04:56Z.
"""

import datetime
import os
import sys

import dateutil.parser

with open(sys.argv[1], "w") as out_fh:
out_fh.write("test")

target_datetime = datetime.datetime.fromisoformat("2010-01-02T03:04:56+00:00")
target_datetime = dateutil.parser.isoparse("2010-01-02T03:04:56+00:00")
target_timestamp = target_datetime.timestamp()
os.utime(sys.argv[1], (target_timestamp, target_timestamp))
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
PyLD
pytest
python-dateutil