tox.ini
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Wed, 11 Sep 2019 11:56:43 +0200
branch3.26
changeset 12726 1a2c7d6397ec
parent 12432 2fcb53ee5178
child 12491 540904e0ff0f
permissions -rw-r--r--
Avoid to update inlined relation column to NULL when deleting entities When deleting entities, cubicweb run a rql DELETE on all relations to trigger hooks. For an inlined relation this also mean set the column to NULL. This operation may fail if there's additional constraints on the column. Also this is a weird and useless behavior since deleting the entity row will by definition delete the relation. We still doesn't handle the case where both subject and object are going to be deleted because rows need to be deleted in a particular order that cubicweb doesn't handle. Add a test checking UPDATE does not occur but hooks are correctly called. Closes #17236690

[tox]
envlist =
  check-manifest,flake8,
  py{27,3}-{server,web,misc}

[testenv]
deps =
  -r{toxinidir}/requirements/dev.txt
  py27: backports.tempfile
  misc: -r{toxinidir}/requirements/test-misc.txt
  server: -r{toxinidir}/requirements/test-server.txt
  web: -r{toxinidir}/requirements/test-web.txt
commands =
  misc: {envpython} -m pip install --upgrade --no-deps --quiet git+git://github.com/logilab/yapps@master#egg=yapps
  misc: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/test {toxinidir}/cubicweb/dataimport/test {toxinidir}/cubicweb/devtools/test {toxinidir}/cubicweb/entities/test {toxinidir}/cubicweb/ext/test {toxinidir}/cubicweb/hooks/test {toxinidir}/cubicweb/sobjects/test {toxinidir}/cubicweb/wsgi/test {toxinidir}/cubicweb/pyramid/test
  py27-misc: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/etwist/test
  server: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/server/test
  web: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/web/test

[testenv:flake8]
basepython=python3
skip_install = true
deps =
  flake8 >= 3.6
whitelist_externals =
  /bin/sh
commands = /bin/sh -c "flake8 `xargs -a {toxinidir}/flake8-ok-files.txt`"

[testenv:doc]
skip_install = true
changedir = doc
deps =
  sphinx
  -r{toxinidir}/requirements/doc.txt
commands =
  {envpython} -m sphinx -b html -d {envtmpdir}/doctrees .  {envtmpdir}/html

[testenv:check-manifest]
skip_install = true
deps =
  check-manifest
commands =
  {envpython} -m check_manifest {toxinidir} \
# ignore symlinks that are not recognized by check-manifest, see
# https://github.com/mgedmin/check-manifest/issues/69
    --ignore cubicweb/devtools/test/data/cubes/i18ntestcube*,cubicweb/test/data/legacy_cubes*

[pytest]
python_files = *test_*.py
log_print = false

[flake8]
format = pylint
ignore = W503
max-line-length = 100
exclude = doc/*,.tox/*


# vim: wrap sts=2 sw=2