def METHOD_NAME(self):
    # This matches the BUILD.bazel rule for this test program.
    self.assertEqual(os.environ.get("DRAKE_NUM_THREADS"), "2")
    max_num_threads = 2
    # Construction.
    mut.Parallelism()
    mut.Parallelism(parallelize=False)
    mut.Parallelism(num_threads=1)
    mut.Parallelism.Max()
    # Copyable.
    copy.copy(mut.Parallelism())
    # The num_threads() getter.
    self.assertEqual(mut.Parallelism().num_threads(), 1)
    self.assertEqual(mut.Parallelism.Max().num_threads(), max_num_threads)
    # Construction without kwarg names must be careful not to automatically
    # convert between bool and int.
    self.assertEqual(mut.Parallelism(False).num_threads(), 1)
    self.assertEqual(mut.Parallelism(True).num_threads(), max_num_threads)
    self.assertEqual(mut.Parallelism(1).num_threads(), 1)
    self.assertEqual(mut.Parallelism(3).num_threads(), 3)
    # Floats are right out.
    with self.assertRaisesRegex(Exception, "types"):
        mut.Parallelism(0.5)