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 074b3a7
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 38 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
@@ -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
6 changes: 2 additions & 4 deletions requirements.txt
@@ -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
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='spulec@gmail.com',
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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
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 074b3a7

Please sign in to comment.