* Fix tests

* Add extra folders to make test command

* Update snapshots

* Add python 3.8 to test matrix

* Add black command to makefile and black dependency to setup.py

* Add lint command

* Run format

* Remove 3.8 from test matrix

* Add Python 3.8 to test matrix

* Update setup.py
This commit is contained in:
Jonathan Kim 2019-12-31 14:08:30 +00:00 committed by GitHub
parent 81d61f82c5
commit bd6d8d086d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 19 deletions

View File

@ -4,6 +4,7 @@ dist: xenial
python:
- "3.6"
- "3.7"
- "3.8"
install:
- pip install tox tox-travis

View File

@ -5,10 +5,10 @@ help:
.PHONY: install-dev ## Install development dependencies
install-dev:
pip install -e ".[test]"
pip install -e ".[dev]"
test:
py.test graphene
py.test graphene examples tests_asyncio
.PHONY: docs ## Generate docs
docs: install-dev
@ -17,3 +17,11 @@ docs: install-dev
.PHONY: docs-live ## Generate docs with live reloading
docs-live: install-dev
cd docs && make install && make livehtml
.PHONY: format
format:
black graphene examples setup.py tests_asyncio
.PHONY: lint
lint:
flake8 graphene examples setup.py tests_asyncio

View File

@ -4,6 +4,7 @@ from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots["test_correctly_fetches_id_name_rebels 1"] = {
@ -84,9 +85,10 @@ type PageInfo {
type Query {
rebels: Faction
empire: Faction
"""The ID of the object"""
node(id: ID!): Node
node(
"""The ID of the object"""
id: ID!
): Node
}
"""A ship in the Star Wars saga"""

View File

@ -183,15 +183,18 @@ def test_str_schema():
type RootQuery {
first: String
"""The ID of the object"""
node(id: ID!): Node
"""The ID of the object"""
onlyNode(id: ID!): MyNode
"""The ID of the object"""
onlyNodeLazy(id: ID!): MyNode
node(
"""The ID of the object"""
id: ID!
): Node
onlyNode(
"""The ID of the object"""
id: ID!
): MyNode
onlyNodeLazy(
"""The ID of the object"""
id: ID!
): MyNode
}
'''
)

View File

@ -78,8 +78,10 @@ def test_str_schema_correct():
}
type RootQuery {
"""The ID of the object"""
node(id: ID!): Node
node(
"""The ID of the object"""
id: ID!
): Node
}
type User implements Node {

View File

@ -59,6 +59,8 @@ tests_require = [
"iso8601",
]
dev_requires = ["black==19.3b0", "flake8==3.7.7"] + tests_require
setup(
name="graphene",
version=version,
@ -76,15 +78,16 @@ setup(
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
keywords="api graphql protocol rest relay graphene",
packages=find_packages(exclude=["tests", "tests.*", "examples"]),
install_requires=[
"graphql-core>=3.0.0a0,<4",
"graphql-relay>=3.0.0a0,<4",
"graphql-core>=3.0.0,<4",
"graphql-relay>=3.0.0,<4",
"aniso8601>=6,<9",
],
tests_require=tests_require,
extras_require={"test": tests_require},
extras_require={"test": tests_require, "dev": dev_requires},
cmdclass={"test": PyTest},
)