10000 Revert changes to contiguous flags definition while creating NPY_TEST_UNSAFE_STRIDES by seberg · Pull Request #3162 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Revert changes to contiguous flags definition while creating NPY_TEST_UNSAFE_STRIDES #3162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 3, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
TST: Add NPY_RELAXED_STRIDES_CHECKING to Travis
  • Loading branch information
seberg committed Apr 2, 2013
commit 507b09e523e11610ea7f9bf3350b2258120ab0d2
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ matrix:
include:
- python: 2.7
env: NPY_SEPARATE_COMPILATION=0
- python: 3.2
- python: 3.3
env: NPY_SEPARATE_COMPILATION=0
- python: 2.7
env: NPY_RELAXED_STRIDES_CHECKING=1
- python: 3.3
env: NPY_RELAXED_STRIDES_CHECKING=1
before_install:
- uname -a
- free -m
Expand Down
13 changes: 12 additions & 1 deletion tools/test-installed-numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# But, python2.4's -m switch only works with top-level modules, not modules
# that are inside packages. So, once we drop 2.4 support, maybe...

import sys
import sys, os
# In case we are run from the source directory, we don't want to import numpy
# from there, we want to import the installed version:
sys.path.pop(0)
Expand All @@ -35,6 +35,17 @@
(options, args) = parser.parse_args()

import numpy

# Check that NPY_RELAXED_STRIDES_CHECKING is active when set.
# The same flags check is also used in the tests to switch behavior.
if (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "0") != "0"):
if not numpy.ones((10,1), order='C').flags.f_contiguous:
print('NPY_RELAXED_STRIDES_CHECKING set, but not active.')
sys.exit(1)
elif numpy.ones((10,1), order='C').flags.f_contiguous:
print('NPY_RELAXED_STRIDES_CHECKING not set, but active.')
sys.exit(1)

result = numpy.test(options.mode,
verbose=options.verbose,
extra_argv=args,
Expand Down
0