Skip to content

Commit

Permalink
[cleanup] Fix CI tests and some various cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Vallet committed Jul 21, 2020
1 parent 9b730f0 commit c60dd14
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 40 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
language: python
cache: pip
python:
- 3.5
- 3.6
- 3.7
- 3.8
- pypy3

script: make travis
install:
- pip install .
- pip install -r requirements.txt
install: pip install tox-travis
script:
tox
after_success:
- coveralls
2 changes: 0 additions & 2 deletions freezegun/_async.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import functools

import asyncio


def wrap_coroutine(api, coroutine):
@functools.wraps(coroutine)
Expand Down
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
coverage
pytest
pytest-coverage
coveralls
mock
pytest>=4.6
maya; python_version >= '3.6'
maya; python_version >= '3.7'
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

from setuptools import setup

requires = ['python-dateutil>=2.7']
tests_require = ['nose']

with open('README.rst') as f:
readme = f.read()

Expand All @@ -17,8 +14,7 @@
author_email='[email protected]',
url='https://github.com/spulec/freezegun',
packages=['freezegun'],
install_requires=requires,
tests_require=tests_require,
install_requires=['python-dateutil>=2.7'],
include_package_data=True,
license='Apache 2.0',
python_requires='>=3.5',
Expand Down
3 changes: 1 addition & 2 deletions tests/fake_module.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datetime import datetime
from datetime import date
from datetime import date, datetime
from time import time, localtime, gmtime, strftime


Expand Down
11 changes: 3 additions & 8 deletions tests/test_asyncio.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import asyncio
import datetime
from textwrap import dedent
from unittest import SkipTest


from freezegun import freeze_time

try:
import asyncio
except ImportError:
asyncio = False


def test_time_freeze_coroutine():
if not asyncio:
raise SkipTest('asyncio required')
@asyncio.coroutine

@freeze_time('1970-01-01')
def frozen_coroutine():
async def frozen_coroutine():
assert datetime.date.today() == datetime.date(1970, 1, 1)

asyncio.get_event_loop().run_until_complete(frozen_coroutine())
Expand Down
1 change: 0 additions & 1 deletion tests/test_datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

try:
import maya

except ImportError:
maya = None

Expand Down
6 changes: 2 additions & 4 deletions tests/test_ticking.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import datetime
import time
try:
from unittest import mock
except (ImportError, AttributeError):
import mock

from unittest import mock
import pytest

from freezegun import freeze_time
Expand Down
7 changes: 1 addition & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
from unittest import SkipTest

try:
from unittest import mock
except (ImportError, AttributeError):
import mock
from unittest import SkipTest, mock

from freezegun import api
from tests import utils
Expand Down
1 change: 0 additions & 1 deletion tests/test_uuid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function, absolute_import, unicode_literals
import datetime
import uuid

Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
envlist = py35, py36, py37, py38, pypy3

[testenv]
commands = make test NOSE_ARGS="{posargs}"
whitelist_externals = make
commands = pytest --cov
deps = -rrequirements.txt

0 comments on commit c60dd14

Please sign in to comment.