Skip to content

Commit

Permalink
use pytest instead of nosetests
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk authored and tobixen committed Jun 30, 2022
1 parent 6b791de commit 31b1618
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 248 deletions.
2 changes: 1 addition & 1 deletion caldav/lib/vcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def fix(event):
"""
## TODO: add ^ before COMPLETED and CREATED?
## 1) Add a random time if completed is given as date
fixed = re.sub('COMPLETED:(\d+)\s', 'COMPLETED:\g<1>T120000Z',
fixed = re.sub(r'COMPLETED:(\d+)\s', r'COMPLETED:\g<1>T120000Z',
to_local(event))

## 2) CREATED timestamps prior to epoch does not make sense,
Expand Down
9 changes: 2 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
[nosetests]
detailed-errors = 1
with-coverage = 1
cover-package = caldav

[tox:tox]
envlist = py37,py38,py39,py310

[testenv]
commands =
python setup.py test
deps = --editable .[test]
commands = pytest {posargs:--cov}

[build_sphinx]
source-dir = docs/source
Expand Down
17 changes: 16 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
except:
extra_test_packages = ['mock']

test_packages = [
"pytest",
"pytest-coverage",
"icalendar",
"coverage",
"nose",
"tzlocal",
"pytz",
"xandikos<0.2.4",
"radicale",
]

setup(
name='caldav',
version=version,
Expand All @@ -49,5 +61,8 @@
include_package_data=True,
zip_safe=False,
install_requires=['vobject', 'lxml', 'requests', 'six'] + extra_packages,
tests_require=['icalendar', 'nose', 'coverage', 'tzlocal', 'pytz', 'xandikos<0.2.4', 'radicale'] + extra_test_packages
tests_require=test_packages + extra_test_packages,
extras_require={
"test": test_packages,
},
)
Loading

0 comments on commit 31b1618

Please sign in to comment.