• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:suite +full:- +full:vm

15 --------------------------------------------------------
17 Check :ref:`the Library Reference <library-index>` to see if there's a relevant
21 For third-party packages, search the `Python Package Index
28 -------------------------------------------------------------
30 If you can't find a source file for a module it may be a built-in or
47 -------------------------------------------------
79 .. code-block:: sh
94 ---------------------------------------------
100 (Note that this is not available in the Windows distribution -- there is no
111 -------------------------------------------------
118 ----------------------------------
134 How do I test a Python program or component?
135 --------------------------------------------
146 encapsulated in either functions or class methods -- and this sometimes has the
160 behaviours, you should write test functions that exercise the behaviours. A
161 test suite that automates a sequence of tests can be associated with each module.
164 your test functions in parallel with the "production code", since this makes it
168 include a self-test of the module. ::
179 -----------------------------------------------
184 <https://www.sphinx-doc.org>`_ can also include docstring content.
188 -----------------------------------------
225 and modify them for non-blocking mode. Since reading stdin when it is empty
237 -------------------------------
241 low-level primitives provided by the :mod:`_thread` module.
245 ------------------------------------
263 time.sleep(10) # <---------------------------!
272 time.sleep(0.001) # <--------------------!
290 ---------------------------------------------------------
342 .. code-block:: none
362 What kinds of global value mutation are thread-safe?
363 ----------------------------------------------------
366 thread runs in the Python VM at a time. In general, Python offers to switch
374 variables of built-in data types (ints, lists, dicts, etc) that "look atomic"
395 L.append(L[-1])
406 ------------------------------------------------
411 deployment on high-end multiprocessor server machines, because a multi-threaded
417 with fine-grained locking. Adam Olsen recently did a similar experiment
418 in his `python-safethread <https://code.google.com/archive/p/python-safethread>`_
419 project. Unfortunately, both experiments exhibited a sharp drop in single-thread
420 performance (at least 30% slower), due to the amount of fine-grained locking
423 This doesn't mean that you can't make good use of Python on multi-CPU machines!
428 :mod:`multiprocessing` module provides a lower-level API in case you want
432 perform a time-consuming task, the extension can release the GIL while the
437 It has been suggested that the GIL should be a per-interpreter-state lock rather
459 -----------------------------------------------------
484 ---------------------
497 -------------------------------------
503 For example, the following code reads two 2-byte integers and one 4-byte integer
504 in big-endian format from a file::
512 The '>' in the format string forces big-endian data; the letter 'h' reads one
529 ---------------------------------------------------------------------
531 :func:`os.read` is a low-level function which takes a file descriptor, a small
532 integer representing the opened file. :func:`os.popen` creates a high-level
533 file object, the same type returned by the built-in :func:`open` function.
538 .. XXX update to use subprocess. See the :ref:`subprocess-replacements` section.
541 ------------------------------------------------------------------------
584 This is a deadlock-safe version of popen that returns
618 ----------------------------------------
630 ---------------------------------------------------------------
632 Python :term:`file objects <file object>` are a high-level layer of
633 abstraction on low-level C file descriptors.
635 For most file objects you create in Python via the built-in :func:`open`
643 the Python-level file object as being closed, but does *not* close the
661 ------------------------------------
664 Reference Manual. Python has many modules that will help you build server-side
665 and client-side web systems.
677 --------------------------------------------------
692 req = urllib.request.urlopen('http://www.some-server.out-there'
693 '/cgi-bin/some-cgi-script', data=qs)
697 Note that in general for percent-encoded POST operations, query strings must be
705 .. seealso:: :ref:`urllib-howto` for extensive examples.
709 ------------------------------------------------------
718 ----------------------------------------
742 A Unix-only alternative uses sendmail. The location of the sendmail program
750 p = os.popen("%s -t -i" % SENDMAIL, "w")
752 p.write("Subject: test\n")
762 ------------------------------------------------------------
767 To prevent the TCP connect from blocking, you can set the socket to non-blocking
776 -- ``0`` or ``errno.EISCONN`` indicate that you're connected -- or you can pass this
780 The :mod:`asyncio` module provides a general purpose single-threaded and
781 concurrent asynchronous library, which can be used for writing non-blocking
783 The third-party `Twisted <https://twisted.org/>`_ library is
784 a popular and feature-rich alternative.
791 --------------------------------------------------------
795 Interfaces to disk-based hashes such as :mod:`DBM <dbm.ndbm>` and :mod:`GDBM
797 :mod:`sqlite3` module, which provides a lightweight disk-based relational
806 --------------------------------------------------
818 -------------------------------------------
834 Some higher-level functions operate on sequences directly, such as:
837 * ``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly.