* 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: python:
- "3.6" - "3.6"
- "3.7" - "3.7"
- "3.8"
install: install:
- pip install tox tox-travis - pip install tox tox-travis

View File

@ -5,10 +5,10 @@ help:
.PHONY: install-dev ## Install development dependencies .PHONY: install-dev ## Install development dependencies
install-dev: install-dev:
pip install -e ".[test]" pip install -e ".[dev]"
test: test:
py.test graphene py.test graphene examples tests_asyncio
.PHONY: docs ## Generate docs .PHONY: docs ## Generate docs
docs: install-dev docs: install-dev
@ -17,3 +17,11 @@ docs: install-dev
.PHONY: docs-live ## Generate docs with live reloading .PHONY: docs-live ## Generate docs with live reloading
docs-live: install-dev docs-live: install-dev
cd docs && make install && make livehtml 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 from snapshottest import Snapshot
snapshots = Snapshot() snapshots = Snapshot()
snapshots["test_correctly_fetches_id_name_rebels 1"] = { snapshots["test_correctly_fetches_id_name_rebels 1"] = {
@ -84,9 +85,10 @@ type PageInfo {
type Query { type Query {
rebels: Faction rebels: Faction
empire: Faction empire: Faction
node(
"""The ID of the object""" """The ID of the object"""
node(id: ID!): Node id: ID!
): Node
} }
"""A ship in the Star Wars saga""" """A ship in the Star Wars saga"""

View File

@ -183,15 +183,18 @@ def test_str_schema():
type RootQuery { type RootQuery {
first: String first: String
node(
"""The ID of the object""" """The ID of the object"""
node(id: ID!): Node id: ID!
): Node
"""The ID of the object""" onlyNode(
onlyNode(id: ID!): MyNode """The ID of the object"""
id: ID!
"""The ID of the object""" ): MyNode
onlyNodeLazy(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 { type RootQuery {
"""The ID of the object""" node(
node(id: ID!): Node """The ID of the object"""
id: ID!
): Node
} }
type User implements Node { type User implements Node {

View File

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