Coverage for /usr/local/lib/python3.7/site-packages/hypothesis/configuration.py : 31%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of Hypothesis, which may be found at
2# https://github.com/HypothesisWorks/hypothesis/
3#
4# Most of this work is copyright (C) 2013-2020 David R. MacIver
5# (david@drmaciver.com), but it contains contributions by others. See
6# CONTRIBUTING.rst for a full list of people who may hold copyright, and
7# consult the git log if you need to determine who owns an individual
8# contribution.
9#
10# This Source Code Form is subject to the terms of the Mozilla Public License,
11# v. 2.0. If a copy of the MPL was not distributed with this file, You can
12# obtain one at https://mozilla.org/MPL/2.0/.
13#
14# END HEADER
16import os
18__hypothesis_home_directory_default = os.path.join(os.getcwd(), ".hypothesis")
20__hypothesis_home_directory = None
23def set_hypothesis_home_dir(directory):
24 global __hypothesis_home_directory
25 __hypothesis_home_directory = directory
28def mkdir_p(path):
29 try:
30 os.makedirs(path)
31 except OSError:
32 pass
35def storage_directory(*names):
36 global __hypothesis_home_directory
37 if not __hypothesis_home_directory:
38 __hypothesis_home_directory = os.getenv("HYPOTHESIS_STORAGE_DIRECTORY")
39 if not __hypothesis_home_directory:
40 __hypothesis_home_directory = __hypothesis_home_directory_default
41 return os.path.join(__hypothesis_home_directory, *names)