Repository: sympy/sympy

Issue:
Using nsolve on an inequality gives unexpected result
Attempting to use `nsolve` on an inequality 

```py
>>> from sympy import nsolve, Symbol
>>> x = Symbol('x')
>>> nsolve(x < 0.5, x, 1)
1.00000000000000
```

gives an unexpected result. `nsolve` isn't designed to handle inequalities, just "[a nonlinear equation system](https://docs.sympy.org/dev/modules/solvers/solvers.html?highlight=nsolve#sympy.solvers.solvers.nsolve)", so perhaps it should detect them and throw an error like "nsolve cannot accept inequalities"?

A user might think `nsolve` will solve inequalities in analogy to [`solve`](https://docs.sympy.org/dev/modules/solvers/solvers.html?highlight=nsolve#sympy.solvers.solvers.solve), which (at least currently) accepts both equations and inequalities.

Discussion:

Patch:
diff --git a/asv.conf.actions.json b/asv.conf.actions.json
index 5d87a7dff1..77cfed0573 100644
--- a/asv.conf.actions.json
+++ b/asv.conf.actions.json
@@ -22,7 +22,7 @@
 
     // This list needs to be updated after each release of sympy. The branch to
     // be checked should always be the previous release.
-    "branches": ["upstream/1.12", "upstream/master", "HEAD"], // for git
+    "branches": ["upstream/1.11", "upstream/master", "HEAD"], // for git
     // "branches": ["tip"],    // for mercurial
 
     // The DVCS being used.  If not set, it will be automatically
diff --git a/sympy/combinatorics/util.py b/sympy/combinatorics/util.py
index fc73b02f94..94e736f56e 100644
--- a/sympy/combinatorics/util.py
+++ b/sympy/combinatorics/util.py
@@ -134,12 +134,13 @@ def _distribute_gens_by_base(base, gens):
 
     Returns
     =======
-    list
-        List of length `k`, where `k` is the length of *base*. The `i`-th entry
-        contains those elements in *gens* which fix the first `i` elements of
-        *base* (so that the `0`-th entry is equal to *gens* itself). If no
-        element fixes the first `i` elements of *base*, the `i`-th element is
-        set to a list containing the identity element.
+
+    List of length `k`, where `k` is
+    the length of ``base``. The `i`-th entry contains those elements in
+    ``gens`` which fix the first `i` elements of ``base`` (so that the
+    `0`-th entry is equal to ``gens`` itself). If no element fixes the first
+    `i` elements of ``base``, the `i`-th element is set to a list containing
+    the identity element.
 
     Examples
     ========
@@ -195,19 +196,20 @@ def _handle_precomputed_bsgs(base, strong_gens, transversals=None,
     Parameters
     ==========
 
-    base : the base
-    strong_gens : the strong generators
-    transversals : basic transversals
-    basic_orbits : basic orbits
-    strong_gens_distr : strong generators distributed by membership in basic stabilizers
+    ``base`` - the base
+    ``strong_gens`` - the strong generators
+    ``transversals`` - basic transversals
+    ``basic_orbits`` - basic orbits
+    ``strong_gens_distr`` - strong generators distributed by membership in basic
+    stabilizers
 
     Returns
     =======
 
-    (transversals, basic_orbits, strong_gens_distr)
-        where *transversals* are the basic transversals, *basic_orbits* are the
-        basic orbits, and *strong_gens_distr* are the strong generators distributed
-        by membership in basic stabilizers.
+    ``(transversals, basic_orbits, strong_gens_distr)`` where ``transversals``
+    are the basic transversals, ``basic_orbits`` are the basic orbits, and
+    ``strong_gens_distr`` are the strong generators distributed by membership
+    in basic stabilizers.
 
     Examples
     ========
@@ -260,12 +262,13 @@ def _orbits_transversals_from_bsgs(base, strong_gens_distr,
     Parameters
     ==========
 
-    base : The base.
-    strong_gens_distr : Strong generators distributed by membership in basic stabilizers.
-    transversals_only : bool, default: False
+    ``base`` - The base.
+    ``strong_gens_distr`` - Strong generators distributed by membership in basic
+    stabilizers.
+    ``transversals_only`` - bool
         A flag switching between returning only the
         transversals and both orbits and transversals.
-    slp : bool, default: False
+    ``slp`` -
         If ``True``, return a list of dictionaries containing the
         generator presentations of the elements of the transversals,
         i.e. the list of indices of generators from ``strong_gens_distr[i]``
@@ -316,10 +319,11 @@ def _remove_gens(base, strong_gens, basic_orbits=None, strong_gens_distr=None):
     Parameters
     ==========
 
-    base : a base
-    strong_gens : a strong generating set relative to *base*
-    basic_orbits : basic orbits
-    strong_gens_distr : strong generators distributed by membership in basic stabilizers
+    ``base`` - a base
+    ``strong_gens`` - a strong generating set relative to ``base``
+    ``basic_orbits`` - basic orbits
+    ``strong_gens_distr`` - strong generators distributed by membership in basic
+    stabilizers
 
     Returns
     =======
@@ -402,16 +406,15 @@ def _strip(g, base, orbits, transversals):
     Parameters
     ==========
 
-    g : permutation to be decomposed
-    base : sequence of points
-    orbits : list
-        A list in which the ``i``-th entry is an orbit of ``base[i]``
-        under some subgroup of the pointwise stabilizer of `
-        `base[0], base[1], ..., base[i - 1]``. The groups themselves are implicit
-        in this function since the only information we need is encoded in the orbits
-        and transversals
-    transversals : list
-        A list of orbit transversals associated with the orbits *orbits*.
+    ``g`` - permutation to be decomposed
+    ``base`` - sequence of points
+    ``orbits`` - a list in which the ``i``-th entry is an orbit of ``base[i]``
+    under some subgroup of the pointwise stabilizer of `
+    `base[0], base[1], ..., base[i - 1]``. The groups themselves are implicit
+    in this function since the only information we need is encoded in the orbits
+    and transversals
+    ``transversals`` - a list of orbit transversals associated with the orbits
+    ``orbits``.
 
     Examples
     ========
@@ -500,7 +503,8 @@ def _strong_gens_from_distr(strong_gens_distr):
     Parameters
     ==========
 
-    strong_gens_distr : strong generators distributed by membership in basic stabilizers
+    ``strong_gens_distr`` - strong generators distributed by membership in basic
+    stabilizers
 
     Examples
     ========
diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py
index b3a2ad0737..c37c782280 100644
--- a/sympy/core/numbers.py
+++ b/sympy/core/numbers.py
@@ -827,9 +827,9 @@ def as_coeff_add(self, *deps):
 
     def as_coeff_Mul(self, rational=False):
         """Efficiently extract the coefficient of a product."""
-        if not rational:
-            return self, S.One
-        return S.One, self
+        if rational and not self.is_Rational:
+            return S.One, self
+        return (self, S.One) if self else (S.One, self)
 
     def as_coeff_Add(self, rational=False):
         """Efficiently extract the coefficient of a summation."""
diff --git a/sympy/simplify/cse_main.py b/sympy/simplify/cse_main.py
index 3b7a2d9665..d603560f59 100644
--- a/sympy/simplify/cse_main.py
+++ b/sympy/simplify/cse_main.py
@@ -512,14 +512,7 @@ def _find_opts(expr):
         list(map(_find_opts, expr.args))
 
         if not isinstance(expr, MatrixExpr) and expr.could_extract_minus_sign():
-            # XXX -expr does not always work rigorously for some expressions
-            # containing UnevaluatedExpr.
-            # https://github.com/sympy/sympy/issues/24818
-            if isinstance(expr, Add):
-                neg_expr = Add(*(-i for i in expr.args))
-            else:
-                neg_expr = -expr
-
+            neg_expr = -expr
             if not neg_expr.is_Atom:
                 opt_subs[expr] = Unevaluated(Mul, (S.NegativeOne, neg_expr))
                 seen_subexp.add(neg_expr)
diff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py
index adc467fd43..fcc7e13c31 100644
--- a/sympy/solvers/solvers.py
+++ b/sympy/solvers/solvers.py
@@ -3028,6 +3028,8 @@ def nsolve(*args, dict=False, **kwargs):
         # assume it's a SymPy expression
         if isinstance(f, Eq):
             f = f.lhs - f.rhs
+        elif f.is_Relational:
+            raise TypeError('nsolve cannot accept inequalities')
         syms = f.free_symbols
         if fargs is None:
             fargs = syms.copy().pop()
diff --git a/sympy/utilities/codegen.py b/sympy/utilities/codegen.py
index 9d0f8f84a2..01ad877864 100644
--- a/sympy/utilities/codegen.py
+++ b/sympy/utilities/codegen.py
@@ -297,7 +297,7 @@ def __init__(self, name, datatype=None, dimensions=None, precision=None):
             When not given, the data type will be guessed based on the
             assumptions on the symbol argument.
 
-        dimensions : sequence containing tuples, optional
+        dimension : sequence containing tupes, optional
             If present, the argument is interpreted as an array, where this
             sequence of tuples specifies (lower, upper) bounds for each
             index of the array.
@@ -315,7 +315,7 @@ def __init__(self, name, datatype=None, dimensions=None, precision=None):
                             "instance of the DataType class.")
         if dimensions and not isinstance(dimensions, (tuple, list)):
             raise TypeError(
-                "The dimensions argument must be a sequence of tuples")
+                "The dimension argument must be a sequence of tuples")
 
         self._name = name
         self._datatype = {
@@ -419,7 +419,7 @@ def __init__(self, name, result_var, expr, datatype=None, dimensions=None, preci
             When not given, the data type will be guessed based on the
             assumptions on the symbol argument.
 
-        dimensions : sequence containing tuples, optional
+        dimension : sequence containing tupes, optional
             If present, the argument is interpreted as an array, where this
             sequence of tuples specifies (lower, upper) bounds for each
             index of the array.
@@ -491,7 +491,7 @@ def __init__(self, expr, name=None, result_var=None, datatype=None,
             When not given, the data type will be guessed based on the
             assumptions on the expr argument.
 
-        dimensions : sequence containing tuples, optional
+        dimension : sequence containing tupes, optional
             If present, this variable is interpreted as an array,
             where this sequence of tuples specifies (lower, upper)
             bounds for each index of the array.
@@ -1991,7 +1991,7 @@ def get_code_generator(language, project=None, standard=None, printer = None):
 
 def codegen(name_expr, language=None, prefix=None, project="project",
             to_files=False, header=True, empty=True, argument_sequence=None,
-            global_vars=None, standard=None, code_gen=None, printer=None):
+            global_vars=None, standard=None, code_gen=None, printer = None):
     """Generate source code for expressions in a given language.
 
     Parameters
@@ -2042,14 +2042,11 @@ def codegen(name_expr, language=None, prefix=None, project="project",
         Sequence of global variables used by the routine.  Variables
         listed here will not show up as function arguments.
 
-    standard : string, optional
+    standard : string
 
-    code_gen : CodeGen instance, optional
+    code_gen : CodeGen instance
         An instance of a CodeGen subclass. Overrides ``language``.
 
-    printer : Printer instance, optional
-        An instance of a Printer subclass.
-
     Examples
     ========
 
diff --git a/sympy/utilities/enumerative.py b/sympy/utilities/enumerative.py
index ae165ea8c7..017da9b1ba 100644
--- a/sympy/utilities/enumerative.py
+++ b/sympy/utilities/enumerative.py
@@ -668,7 +668,7 @@ def decrement_part_range(self, part, lb, ub):
         Parameters
         ==========
 
-        part
+         part
             part to be decremented (topmost part on the stack)
 
         ub
diff --git a/sympy/utilities/exceptions.py b/sympy/utilities/exceptions.py
index f764a31371..9cffc50aeb 100644
--- a/sympy/utilities/exceptions.py
+++ b/sympy/utilities/exceptions.py
@@ -110,7 +110,8 @@ def sympy_deprecation_warning(message, *, deprecated_since_version,
     Parameters
     ==========
 
-    message : str
+    message: str
+
          The deprecation message. This may span multiple lines and contain
          code examples. Messages should be wrapped to 80 characters. The
          message is automatically dedented and leading and trailing whitespace
@@ -119,7 +120,8 @@ def sympy_deprecation_warning(message, *, deprecated_since_version,
          arbitrary, as it might be huge and make the warning message
          unreadable.
 
-    deprecated_since_version : str
+    deprecated_since_version: str
+
          The version of SymPy the feature has been deprecated since. For new
          deprecations, this should be the version in `sympy/release.py
          <https://github.com/sympy/sympy/blob/master/sympy/release.py>`_
@@ -129,7 +131,8 @@ def sympy_deprecation_warning(message, *, deprecated_since_version,
          argument is required and must be passed as a keyword argument.
          (example:  ``deprecated_since_version="1.10"``).
 
-    active_deprecations_target : str
+    active_deprecations_target: str
+
         The Sphinx target corresponding to the section for the deprecation in
         the :ref:`active-deprecations` document (see
         ``doc/src/explanation/active-deprecations.md``). This is used to
@@ -137,7 +140,8 @@ def sympy_deprecation_warning(message, *, deprecated_since_version,
         argument is required and must be passed as a keyword argument.
         (example: ``active_deprecations_target="deprecated-feature-abc"``)
 
-    stacklevel : int, default: 3
+    stacklevel: int (default: 3)
+
         The ``stacklevel`` parameter that is passed to ``warnings.warn``. If
         you create a wrapper that calls this function, this should be
         increased so that the warning message shows the user line of code that
diff --git a/sympy/utilities/iterables.py b/sympy/utilities/iterables.py
index 5e63041dab..e84a694df7 100644
--- a/sympy/utilities/iterables.py
+++ b/sympy/utilities/iterables.py
@@ -525,12 +525,6 @@ def numbered_symbols(prefix='x', cls=None, start=0, exclude=(), *args, **assumpt
     start : int, optional
         The start number.  By default, it is 0.
 
-    exclude : list, tuple, set of cls, optional
-        Symbols to be excluded.
-
-    *args, **kwargs
-        Additional positional and keyword arguments are passed to the *cls* class.
-
     Returns
     =======
 
@@ -902,7 +896,7 @@ def strongly_connected_components(G):
     Parameters
     ==========
 
-    G : tuple[list, list[tuple[T, T]]
+    graph : tuple[list, list[tuple[T, T]]
         A tuple consisting of a list of vertices and a list of edges of
         a graph whose strongly connected components are to be found.
 
@@ -1056,7 +1050,7 @@ def connected_components(G):
     Parameters
     ==========
 
-    G : tuple[list, list[tuple[T, T]]
+    graph : tuple[list, list[tuple[T, T]]
         A tuple consisting of a list of vertices and a list of edges of
         a graph whose connected components are to be found.
 
@@ -1598,21 +1592,20 @@ def multiset_partitions(multiset, m=None):
 def partitions(n, m=None, k=None, size=False):
     """Generate all partitions of positive integer, n.
 
-    Each partition is represented as a dictionary, mapping an integer
-    to the number of copies of that integer in the partition.  For example,
-    the first partition of 4 returned is {4: 1}, "4: one of them".
-
     Parameters
     ==========
-    n : int
-    m : int, optional
+
+    m : integer (default gives partitions of all sizes)
         limits number of parts in partition (mnemonic: m, maximum parts)
-    k : int, optional
+    k : integer (default gives partitions number from 1 through n)
         limits the numbers that are kept in the partition (mnemonic: k, keys)
-    size : bool, default: False
-        If ``True``, (M, P) is returned where M is the sum of the
+    size : bool (default False, only partition is returned)
+        when ``True`` then (M, P) is returned where M is the sum of the
         multiplicities and P is the generated partition.
-        If ``False``, only the generated partition is returned.
+
+    Each partition is represented as a dictionary, mapping an integer
+    to the number of copies of that integer in the partition.  For example,
+    the first partition of 4 returned is {4: 1}, "4: one of them".
 
     Examples
     ========
@@ -1728,18 +1721,18 @@ def partitions(n, m=None, k=None, size=False):
 
 
 def ordered_partitions(n, m=None, sort=True):
-    """Generates ordered partitions of integer *n*.
+    """Generates ordered partitions of integer ``n``.
 
     Parameters
     ==========
-    n : int
-    m : int, optional
+
+    m : integer (default None)
         The default value gives partitions of all sizes else only
-        those with size m. In addition, if *m* is not None then
+        those with size m. In addition, if ``m`` is not None then
         partitions are generated *in place* (see examples).
-    sort : bool, default: True
+    sort : bool (default True)
         Controls whether partitions are
-        returned in sorted order when *m* is not None; when False,
+        returned in sorted order when ``m`` is not None; when False,
         the partitions are returned as fast as possible with elements
         sorted, but when m|n the partitions will not be in
         ascending lexicographical order.
@@ -1865,7 +1858,7 @@ def ordered_partitions(n, m=None, sort=True):
 
 def binary_partitions(n):
     """
-    Generates the binary partition of *n*.
+    Generates the binary partition of n.
 
     A binary partition consists only of numbers that are
     powers of two. Each step reduces a `2^{k+1}` to `2^k` and


Test patch:
diff --git a/.github/workflows/runtests.yml b/.github/workflows/runtests.yml
index a408ac86c9..981bf09f29 100644
--- a/.github/workflows/runtests.yml
+++ b/.github/workflows/runtests.yml
@@ -20,7 +20,7 @@ jobs:
 
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath flake8 flake8-comprehensions ruff
 
@@ -60,7 +60,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath mypy
 
@@ -77,7 +77,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install sphinx-lint
 
@@ -96,7 +96,7 @@ jobs:
           fetch-depth: 0
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath
       - run: bin/mailmap_check.py
@@ -111,7 +111,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath
       - run: bin/doctest --force-colors
@@ -127,7 +127,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath
       - run: bin/test --force-colors --split=1/2
@@ -142,7 +142,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath
       - run: bin/test --force-colors --split=2/2
@@ -177,13 +177,6 @@ jobs:
       matrix:
         python-version: ['3.9', '3.10', '3.11', 'pypy3.8']
         experimental: [false]
-        #
-        # For now we do not test optional dependencies with 3.12 because as of
-        # 3.12.a.5 it is not possible to pip install numpy. Building numpy,
-        # scipy etc from source is overkill for sympy CI. It is probably not
-        # possible to install builds of most of the other optional dependencies
-        # either (especially since many depend on numpy).
-        #
         # Maybe use this to add 3.12 when the time comes:
         #include:
         #  - python-version: '3.12.0-alpha - 3.12'
@@ -231,7 +224,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath numpy scipy tensorflow
       # Test modules that can use tensorflow
@@ -247,7 +240,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath numpy symengine
       # Test modules that can use tensorflow
@@ -265,7 +258,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath
       - run: bin/test --force-colors --slow --timeout=595 --split=1/2
@@ -280,7 +273,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python -m pip install --upgrade pip
       - run: pip install mpmath
       - run: bin/test --force-colors --slow --timeout=595 --split=2/2
@@ -295,7 +288,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.12.0-alpha - 3.12', 'pypy-3.8']
+        python-version: ['3.8', '3.9', '3.11', 'pypy-3.8']
         experimental: [false]
         # Maybe use this to add 3.12 when the time comes:
         #include:
@@ -320,7 +313,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.12.0-alpha - 3.12', 'pypy-3.8']
+        python-version: ['3.8', '3.9', '3.11', 'pypy-3.8']
         experimental: [false]
         # Maybe use this to add 3.12 when the time comes:
         #include:
@@ -345,7 +338,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.12.0-alpha - 3.12', 'pypy-3.8']
+        python-version: ['3.8', '3.9', '3.11', 'pypy-3.8']
         experimental: [false]
         # Maybe use this to add 3.12 when the time comes:
         #include:
@@ -371,7 +364,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: doc/aptinstall.sh
       - run: pip install -r doc/requirements.txt
       - run: bin/test_sphinx.sh
@@ -411,7 +404,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: python setup.py sdist
       - run: release/compare_tar_against_git.py dist/*.tar.gz .
 
@@ -428,7 +421,7 @@ jobs:
           fetch-depth: 0
       - uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.10'
       - run: pip install asv virtualenv
       - run: git submodule add https://github.com/sympy/sympy_benchmarks.git
 
@@ -441,7 +434,7 @@ jobs:
 
       - run: git remote add upstream https://github.com/sympy/sympy.git
       - run: git fetch upstream master
-      - run: git fetch upstream 1.12
+      - run: git fetch upstream 1.11
 
       - name: Configure benchmarks
         run: asv machine --yes --config asv.conf.actions.json
@@ -453,8 +446,8 @@ jobs:
         # Output benchmark results
       - run: asv compare upstream/master HEAD --config asv.conf.actions.json --factor 1.5 | tee pr_vs_master.txt
       - run: asv compare upstream/master HEAD --config asv.conf.actions.json --factor 1.5 --only-changed | tee pr_vs_master_changed.txt
-      - run: asv compare upstream/1.12 upstream/master --config asv.conf.actions.json --factor 1.5 | tee master_vs_release.txt
-      - run: asv compare upstream/1.12 upstream/master --config asv.conf.actions.json --factor 1.5 --only-changed | tee master_vs_release_changed.txt
+      - run: asv compare upstream/1.11 upstream/master --config asv.conf.actions.json --factor 1.5 | tee master_vs_release.txt
+      - run: asv compare upstream/1.11 upstream/master --config asv.conf.actions.json --factor 1.5 --only-changed | tee master_vs_release_changed.txt
 
         # This workflow does not have write permissions for the repository so
         # we save all outputs as artifacts that can be accessed by the
diff --git a/sympy/core/tests/test_expr.py b/sympy/core/tests/test_expr.py
index c7f916fc57..7e9c166667 100644
--- a/sympy/core/tests/test_expr.py
+++ b/sympy/core/tests/test_expr.py
@@ -1660,7 +1660,6 @@ def test_as_coeff_Mul():
     assert Integer(3).as_coeff_Mul() == (Integer(3), Integer(1))
     assert Rational(3, 4).as_coeff_Mul() == (Rational(3, 4), Integer(1))
     assert Float(5.0).as_coeff_Mul() == (Float(5.0), Integer(1))
-    assert Float(0.0).as_coeff_Mul() == (Float(0.0), Integer(1))
 
     assert (Integer(3)*x).as_coeff_Mul() == (Integer(3), x)
     assert (Rational(3, 4)*x).as_coeff_Mul() == (Rational(3, 4), x)
diff --git a/sympy/simplify/tests/test_cse.py b/sympy/simplify/tests/test_cse.py
index c2f1c7eccf..df82df3b84 100644
--- a/sympy/simplify/tests/test_cse.py
+++ b/sympy/simplify/tests/test_cse.py
@@ -5,7 +5,6 @@
 from sympy.codegen.matrix_nodes import MatrixSolve
 from sympy.core.add import Add
 from sympy.core.containers import Tuple
-from sympy.core.expr import UnevaluatedExpr
 from sympy.core.function import Function
 from sympy.core.mul import Mul
 from sympy.core.power import Pow
@@ -535,20 +534,6 @@ def test_cse_ignore_issue_15002():
     rl = [e.subs(reversed(substs)) for e in reduced]
     assert rl == l
 
-
-def test_cse_unevaluated():
-    xp1 = UnevaluatedExpr(x + 1)
-    # This used to cause RecursionError
-    [(x0, ue)], [red] = cse([(-1 - xp1) / (1 - xp1)])
-    if ue == xp1:
-        assert red == (-1 - x0) / (1 - x0)
-    elif ue == -xp1:
-        assert red == (-1 + x0) / (1 + x0)
-    else:
-        msg = f'Expected common subexpression {xp1} or {-xp1}, instead got {ue}'
-        assert False, msg
-
-
 def test_cse__performance():
     nexprs, nterms = 3, 20
     x = symbols('x:%d' % nterms)
diff --git a/sympy/solvers/tests/test_solvers.py b/sympy/solvers/tests/test_solvers.py
index 4d04a5cea5..c13aa051c9 100644
--- a/sympy/solvers/tests/test_solvers.py
+++ b/sympy/solvers/tests/test_solvers.py
@@ -2173,6 +2173,7 @@ def test_nsolve():
     raises(ValueError, lambda: nsolve(x, (-1, 1), method='bisect'))
     raises(TypeError, lambda: nsolve((x - y + 3,x + y,z - y),(x,y,z),(-50,50)))
     raises(TypeError, lambda: nsolve((x + y, x - y), (0, 1)))
+    raises(TypeError, lambda: nsolve(x < 0.5, x, 1))
 
 
 @slow